<template>
	<view class="page-content">
		<block v-for="(item,index) in list" :key="index">
			<view class="body-box" @click="check">
				<view class="box-l">
					<view class="box-tit">{{i18n.usageRecord.shebei}}：{{item.value}}<text class="t-model"
							:style="{background:item.modeltype==='1'?'#D70000':'#00CD8B'}">{{item.modeltype==='1'?i18n.usageRecord.jihuoban:i18n.usageRecord.tongyongban}}</text></view>
					<view class="box-time">{{i18n.usageRecord.shiyongshijian}}：{{item.date}}</view>
				</view>
				<view class="box-r">{{item.time}}{{i18n.usageRecord.time}}</view>
			</view>
		</block>
	</view>
</template>

<script>
	import {
		mapGetters,
		mapActions
	} from "vuex";
	import store from '@/store';
	import {
		getDeviceUseLogs,
	} from '@/common/api.js';
	export default {
		components: {
		},
		data() {
			return {
				current: 0,
				list: [
				    {
				        value: 'sdas',
						date:'2021/03/02',
						time:'39',
				        modeltype: '1',
				    },
				    {
				        value: 'safsfasf',
						date:'2021/03/02',
						time:'39',
						modeltype: '2',
				    }
				]
			}
		},
		computed: {
			i18n() {
			    return this.$t('message');
			}
		},
		onShow() {
		    // 导航栏多语言
		    uni.setNavigationBarTitle({
		        title: this.i18n.tabBar.usageRecord
		    });
			this.getdata();
		},
		onLoad(option) {
			
		},
		methods: {
			getdata(){
				getDeviceUseLogs().then(res =>{
					console.log(333,res)
					if(res.code === 2000){
						
					}
				})
			},
			check(){
				let _self = this;
				
			}
		}
	}
</script>

<style lang="scss">
	.weixuanzhong{
		width: 36rpx;
		height: 36rpx;
		background: #393939;
		border: 1px solid #646464;
		border-radius: 50%;
	}
	.page-content {
		width: 100vw;
		height: 100%;
		background: $uni-bg-color;
		color: $font-color-w;
		padding: $page-row-spacing;
	}

	.body-box {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		background: $uni-bg-box-color;
		box-shadow: 0rpx 2rpx 9rpx 0rpx rgba(0, 0, 0, 0.44);
		border-radius: 20rpx;
		margin-bottom: 30rpx;
		padding: 30rpx 40rpx;
		color: #FFFFFF;
		.box-l{
			display: flex;
			flex-direction: column;
			display: flex;
			font-size: 32rpx;
			font-weight: 500;
			color: #FFFFFF;
			
			.box-tit {
				margin-bottom: 10rpx;
				.t-model {
					height: 40rpx;
					border-radius: 20rpx;
					padding: 0 16rpx;
					font-size: 20rpx;
					font-weight: 400;
					line-height: 40rpx;
					margin-left: 16rpx;
				}
			}
		}
		.box-r{
			display: flex;
			font-size: 28rpx;
			font-weight: 400;
			color: #DDDDDD;
		}
	}
</style>
